const nodemailer = require("nodemailer");
const fs = require('fs');

const transporter = nodemailer.createTransport({
    host: "smtp.qq.com",
    port: 587,
    secure: false,
    auth: {
        user: '1195047644@qq.com',
        pass: 'caztmieahlycicib'
    },
});

async function main() {
  const info = await transporter.sendMail({
    from: '"newking" <1195047644@qq.com>',
    to: "1027121860@qq.com",
    subject: "Hello", 
    // text: "you are s b"
    html: fs.readFileSync('./index.html')
  });

  console.log("邮件发送成功：", info.messageId);
}

main().catch(console.error);
